package com.bjdd.jdy.entity;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/5/26.
 */

public class ResourceUrlBean {

    /**
     * resourceId : 1
     * chapter : 1
     * resourceUrl : http://7xoe74.media1.z0.glb.clouddn.com/rrkd_news2
     */

    private int resourceId;
    private int chapter;
    private String resourceUrl;

    public static ResourceUrlBean objectFromData(String str) {

        return new Gson().fromJson(str, ResourceUrlBean.class);
    }

    public static List<ResourceUrlBean> arrayResourceUrlBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<ResourceUrlBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getResourceId() {
        return resourceId;
    }

    public void setResourceId(int resourceId) {
        this.resourceId = resourceId;
    }

    public int getChapter() {
        return chapter;
    }

    public void setChapter(int chapter) {
        this.chapter = chapter;
    }

    public String getResourceUrl() {
        return resourceUrl;
    }

    public void setResourceUrl(String resourceUrl) {
        this.resourceUrl = resourceUrl;
    }
}
